package server.conf;

/**
 * @author bwcx_jzy
 * @since 2021/11/18
 */
public class Service {

    private String name;

    private Mapper mapper;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Mapper getMapper() {
        return mapper;
    }

    public void setMapper(Mapper mapper) {
        this.mapper = mapper;
    }

    public Service(Mapper mapper) {
        this.mapper = mapper;
    }

//    public Host matchHost(String url) {
//        url = url.replace("//", "/");
//        Mapper mapper = getMapper();
//        List<Host> hosts = mapper.getHosts();
//        String finalUrl = url;
//        return hosts.stream().filter(host -> finalUrl.startsWith(host.getHostUrl())).findAny().orElse(null);
//    }
}
